/*
 * Location.h
 *
 *  Created on: Dec 21, 2014
 *      Author: wasp
 */

#ifndef LOCATION_H_
#define LOCATION_H_

#include <QObject>

namespace bb
{
    namespace platform
    {
        namespace geo
        {
            class GeoLocation;
            class Marker;
        }
    }
    namespace cascades
    {
        namespace maps
        {
            class MapView;
            class DataProvider;
        }
    }
}


namespace de
{
namespace heimweghelden
{
namespace location
{
    class Route;
    class Location: public QObject
    { Q_OBJECT
    public:
        Location(QObject* parent);
        ~Location();
        bb::platform::geo::GeoLocation* current();
        bb::cascades::maps::MapView* map();
        void setMap(bb::cascades::maps::MapView* map);
        void setRoute(double lat, double lon, QString description);
        void resetRoute();
        void updateDevice(double lat, double lon);
        void centerMap();
        Route* route();
        static double distance(double lat1, double lon1, double lat2, double lon2);
    private:
        bb::platform::geo::GeoLocation* _current;
        bb::cascades::maps::MapView* _map;
        bb::cascades::maps::DataProvider* _deviceLocationDataProvider;
        bool followDevice;
        de::heimweghelden::location::Route* _route;
    };

} /* namespace location */
} /* namespace heimweghelden */
} /* namespace de */

#endif /* LOCATION_H_ */
